package cn.app.android.sichuanxiaoke.com.xiaokeapp.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/8/31 0031.
 */

public class MyAdapter_shopshow extends FragmentPagerAdapter {
    public List<Fragment> list = new ArrayList<>();
    private String[] titles = new String[2];
    public MyAdapter_shopshow(FragmentManager fm,List<Fragment> list,String[] titles) {
        super(fm);
        this.list = list;
        this.titles = titles;
    }
    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    //重写这个方法，将设置每个Tab的标题
    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}

